package com.cqq.pro.util;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSONObject;

public class ResponseUtil {

		public static void outJsonString(HttpServletResponse response, JSONObject json) {
			response.setContentType("text/javascript;charset=UTF-8");
			response.setHeader("Cache-Control",
					"no-store, max-age=0, no-cache, must-revalidate");
			response.addHeader("Cache-Control", "post-check=0, pre-check=0");
			response.setHeader("Pragma", "no-cache");
			try {
				PrintWriter out = response.getWriter();
				out.write(json.toString());
				out.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
}
